x86/nospec: Unwreck the RSB stuffing
authorPeter Zijlstra <peterz@infradead.org>
Tue, 16 Aug 2022 12:28:36 +0000 (14:28 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 2 Sep 2022 13:54:53 +0000 (14:54 +0100)
commitf443ffad53c7ac5bab8448e33d00a4c9611a5dfe
treead3cb9b144c9cf36be78d7ceaa62a1188764c2bb
parentbc84692691c23ebfd2310ca638087d0643a9a37c
x86/nospec: Unwreck the RSB stuffing

Origin: https://lore.kernel.org/stable/3e14d81d0576aed9583d07fbd14e6a502f2d4739.camel@decadent.org.uk/

commit 4e3aa9238277597c6c7624f302d81a7b568b6f2d upstream.

Commit 2b1299322016 ("x86/speculation: Add RSB VM Exit protections")
made a right mess of the RSB stuffing, rewrite the whole thing to not
suck.

Thanks to Andrew for the enlightening comment about Post-Barrier RSB
things so we can make this code less magical.

Cc: stable@vger.kernel.org
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/YvuNdDWoUZSBjYcm@worktop.programming.kicks-ass.net
[bwh: Backported to 5.10: adjust context]
Signed-off-by: Ben Hutchings <benh@debian.org>
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name x86-nospec-Unwreck-the-RSB-stuffing.patch
arch/x86/include/asm/nospec-branch.h